package com.mdb.data;

import java.util.List;

/**
 * 
 * @author Zheng.Ma
 * 
 */
public interface IDataHandler {

	/*********** 增加 **********/
	public <T extends BaseModel> T insert(T model);

	public void insert(String tableName, Object[] arr);

	/*********** 查找 **********/
	public <T extends BaseModel> T get(ITable table, Condition[] conditions);

	public <T extends BaseModel> List<T> getList(ITable table, Condition[] conditions);

	public <T extends BaseModel> T getById(ITable table, String id);

	public long count(String tableName, Object queryObj);

	/*********** 删除 **********/
	public void delete(BaseModel model);

	public void delete(ITable table, Condition[] conditions);

	public void delete(String tableName, Object id);

	public void delete(String tableName, Object[] ids);

	/*********** 修改 **********/
	public void update(BaseModel model);

	public void update(String tableName, Object id, Object o);

}
